<?php
defined('BASEPATH') OR exit('No direct script access allowed');

class Question extends WxHomeController {

	function __construct() {
		parent::__construct();
		$this->load->model("Question_model");		
	}
	function Index(){
		$connar['where']=$this->sqlEscape("db_question.status=?? and (db_question.creator=?? or db_admin.role_id=?? or find_in_set(??,sub_role_id))",array(CommonStatus::UnDeleted[XPHEnum::Value],$_SESSION[SESS_USER_HOME]['id'],WebRole::Manage[XPHEnum::Value],WebRole::Manage[XPHEnum::Value]));
		$connar['join']=array('db_admin','db_admin.id=db_question.creator');
		$connar['items']='db_question.*';
		$data['list']=$this->Question_model->get_list_full($connar);
		$this->load->view('home/question_list',$data);
	}
	function showImg($id){
		$data=$this->Question_model->get_single(array('id'=>$id));
		exit(retJson('返回二维码',true,$data['img']));
	}
	

}